package com.med.mapper;


import com.med.entity.DepartmentDO;
import com.med.entity.DoctorDO;
import com.med.vo.AddDepartmentVO;
import com.med.vo.QueryDepartmentVO;
import com.med.vo.UpdateDepartmentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @BelongsProject: Internet-based-healthcare
 * @BelongsPackage: com.med.mapper
 * @Author: 小龚
 * @CreateTime: 2025-08-14 09:04
 * @Description: TODO
 * @Version: 1.0
 */
@Mapper
public interface DepartmentMapper {

    // 查询科室
    List<DepartmentDO> getDepartment(@Param("vo") QueryDepartmentVO vo);


    // 查询科室(redis预热、同步Redis、MySQL数据)
    List<DepartmentDO> getDepartmentByPreheat();

    // 查询科室是否存在医生
    DoctorDO getDoctor(Integer departmentId);

    // 更改科室的状态
    Integer updateStatus(Integer departmentId);

    // 获取所有的父级科室
    List<DepartmentDO> getParentDepartment();

    // 新增科室
    Integer addDepartment(@Param("vo") AddDepartmentVO vo);

    // 修改科室
    Integer updateDepartmentInfo(@Param("vo") UpdateDepartmentVO vo);


    // 删除科室
    Integer deleteDepartment(Integer departmentId);


    // 查询要修改或者新增的科室名是否存在
    DepartmentDO judge(String departmentName);
}
